﻿using GameEditor.View;
using GameEditor.View.Components;
using PureMVC.Interfaces;
using PureMVC.Patterns;
using System.Windows;
using GameEngine.Model;
using GameEngine.Model.Data;
using GameEditor;
using System;

namespace GameEditor.Commands
{
    public class ThingPropertiesEditor_MenuAction_Command<MyIdType> : SimpleCommand
        where MyIdType : IComparable<MyIdType>
    {
        override public void Execute(INotification notification)
        {
            var mediator = Facade.RetrieveMediator(GameEditorFacade.ThingEditorMediatorName) as ThingPropertiesEditor_MenuMediator<MyIdType>;
            //Facade.RemoveMediator(MyFacade.GameEditorMenuMediatorName);
            switch ((IThingEditorMenuViewConstants.ButtonTags)notification.Body)
            {
                //case IThingEditorMenuViewConstants.ButtonTags.CANCEL:
                //    SendNotification(MyFacade.MY_PAGE_LEVELEDITOR_IN_COMMAND);
                //    break;
                case IThingEditorMenuViewConstants.ButtonTags.OK:
                    mediator.DataProxy.Position = mediator.Position;
                    break;
                case IThingEditorMenuViewConstants.ButtonTags.CANCEL:
                    mediator.Position = mediator.DataProxy.Position;
                    break;
                //case IThingEditorMenuViewConstants.ButtonTags.NEWLEVEL:
                //    var level = new LevelVO<int>(new LevelVOId<int>(MyModelFacade.Instance.CreateNewId()));
                //    MyFacadeHelper.CreateLevel(level);
                //    var dataProxy = MyModelFacade.Helper.GetLevelDataProxy(level);
                //    SendNotification(MyFacade.MY_PAGE_LEVELEDITOR_IN_COMMAND, dataProxy);
                //    break;
                //case IGameEditorMenuViewConstants.ButtonTags.EDITRESOURCEBUTTON:
                //    //SendNotification(MyFacade.PAGE_EDITORLOADGAME_IN_COMMAND);
                //    break;
            }
        }
    }
}
